﻿using MHI.InspectionManager.Data;
using MHI.InspectionManager.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;
using WebFoundation.Data;

namespace MHI.InspectionManager.Business
{
    internal class InspectionModule : WFModule, IInspectionModule
	{
		private DbManager _dbQueryManager;
		private DbManager _dbWriteManager;

		protected DevInspectiondeviceTQueryDAO _devInspectiondeviceTQueryDAO;
		protected DevInspectiondeviceTWritingDAO _devInspectiondeviceTWritingDAO;
		protected DevInspectionpointinfoTQueryDAO _devInspectionpointinfoTQueryDAO;
		protected DevInspectionpointinfoTWritingDAO _devInspectionpointinfoTWritingDAO;
		protected DevInspectionstepTQueryDAO _devInspectionstepTQueryDAO;
		protected DevInspectionstepTWritingDAO _devInspectionstepTWritingDAO;
		protected DevJobinspectionstepTQueryDAO _devJobinspectionstepTQueryDAO;
		protected DevJobinspectionstepTWritingDAO _devJobinspectionstepTWritingDAO;
		protected DevJobpersonsTQueryDAO _devJobpersonsTQueryDAO;
		protected DevJobpersonsTWritingDAO _devJobpersonsTWritingDAO;
		protected DevJobplanTQueryDAO _devJobplanTQueryDAO;
		protected DevJobplanTWritingDAO _devJobplanTWritingDAO;
		protected DevJobsparepartTQueryDAO _devJobsparepartTQueryDAO;
		protected DevJobsparepartTWritingDAO _devJobsparepartTWritingDAO;
		protected DevJobteamsTQueryDAO _devJobteamsTQueryDAO;
		protected DevJobteamsTWritingDAO _devJobteamsTWritingDAO;
		protected DevJobworksheetTQueryDAO _devJobworksheetTQueryDAO;
		protected DevJobworksheetTWritingDAO _devJobworksheetTWritingDAO;
		protected DevMaintenancedetailTQueryDAO _devMaintenancedetailTQueryDAO;
		protected DevMaintenancedetailTWritingDAO _devMaintenancedetailTWritingDAO;
		protected DevMajorrepairdetailTQueryDAO _devMajorrepairdetailTQueryDAO;
		protected DevMajorrepairdetailTWritingDAO _devMajorrepairdetailTWritingDAO;
		protected DevPlandeviceTQueryDAO _devPlandeviceTQueryDAO;
		protected DevPlandeviceTWritingDAO _devPlandeviceTWritingDAO;
		protected DevPlaninspectionpointTQueryDAO _devPlaninspectionpointTQueryDAO;
		protected DevPlaninspectionpointTWritingDAO _devPlaninspectionpointTWritingDAO;
		protected DevPlanroutedataTQueryDAO _devPlanroutedataTQueryDAO;
		protected DevPlanroutedataTWritingDAO _devPlanroutedataTWritingDAO;
		protected DevProcessimTQueryDAO _devProcessimTQueryDAO;
		protected DevProcessimTWritingDAO _devProcessimTWritingDAO;
		protected DevProcessimgroupTQueryDAO _devProcessimgroupTQueryDAO;
		protected DevProcessimgroupTWritingDAO _devProcessimgroupTWritingDAO;
		protected DevProcessinfoTQueryDAO _devProcessinfoTQueryDAO;
		protected DevProcessinfoTWritingDAO _devProcessinfoTWritingDAO;
		protected DevSparepartTQueryDAO _devSparepartTQueryDAO;
		protected DevSparepartTWritingDAO _devSparepartTWritingDAO;
		protected DevTroublereportinfoTQueryDAO _devTroublereportinfoTQueryDAO;
		protected DevTroublereportinfoTWritingDAO _devTroublereportinfoTWritingDAO;
		protected DevUserpositiondataTQueryDAO _devUserpositiondataTQueryDAO;
		protected DevUserpositiondataTWritingDAO _devUserpositiondataTWritingDAO;

		public InspectionModule(string queryConnectionString, string writableConnectionString)
		{
			_dbQueryManager = DbManager.FromConfig(queryConnectionString);
			_dbWriteManager = DbManager.FromConfig(writableConnectionString);
			this._devInspectiondeviceTQueryDAO = new DevInspectiondeviceTQueryDAO(_dbQueryManager);
			this._devInspectiondeviceTWritingDAO = new DevInspectiondeviceTWritingDAO(_dbWriteManager);
			this._devInspectionpointinfoTQueryDAO = new DevInspectionpointinfoTQueryDAO(_dbQueryManager);
			this._devInspectionpointinfoTWritingDAO = new DevInspectionpointinfoTWritingDAO(_dbWriteManager);
			this._devInspectionstepTQueryDAO = new DevInspectionstepTQueryDAO(_dbQueryManager);
			this._devInspectionstepTWritingDAO = new DevInspectionstepTWritingDAO(_dbWriteManager);
			this._devJobinspectionstepTQueryDAO = new DevJobinspectionstepTQueryDAO(_dbQueryManager);
			this._devJobinspectionstepTWritingDAO = new DevJobinspectionstepTWritingDAO(_dbWriteManager);
			this._devJobpersonsTQueryDAO = new DevJobpersonsTQueryDAO(_dbQueryManager);
			this._devJobpersonsTWritingDAO = new DevJobpersonsTWritingDAO(_dbWriteManager);
			this._devJobplanTQueryDAO = new DevJobplanTQueryDAO(_dbQueryManager);
			this._devJobplanTWritingDAO = new DevJobplanTWritingDAO(_dbWriteManager);
			this._devJobsparepartTQueryDAO = new DevJobsparepartTQueryDAO(_dbQueryManager);
			this._devJobsparepartTWritingDAO = new DevJobsparepartTWritingDAO(_dbWriteManager);
			this._devJobteamsTQueryDAO = new DevJobteamsTQueryDAO(_dbQueryManager);
			this._devJobteamsTWritingDAO = new DevJobteamsTWritingDAO(_dbWriteManager);
			this._devJobworksheetTQueryDAO = new DevJobworksheetTQueryDAO(_dbQueryManager);
			this._devJobworksheetTWritingDAO = new DevJobworksheetTWritingDAO(_dbWriteManager);
			this._devMaintenancedetailTQueryDAO = new DevMaintenancedetailTQueryDAO(_dbQueryManager);
			this._devMaintenancedetailTWritingDAO = new DevMaintenancedetailTWritingDAO(_dbWriteManager);
			this._devMajorrepairdetailTQueryDAO = new DevMajorrepairdetailTQueryDAO(_dbQueryManager);
			this._devMajorrepairdetailTWritingDAO = new DevMajorrepairdetailTWritingDAO(_dbWriteManager);
			this._devPlandeviceTQueryDAO = new DevPlandeviceTQueryDAO(_dbQueryManager);
			this._devPlandeviceTWritingDAO = new DevPlandeviceTWritingDAO(_dbWriteManager);
			this._devPlaninspectionpointTQueryDAO = new DevPlaninspectionpointTQueryDAO(_dbQueryManager);
			this._devPlaninspectionpointTWritingDAO = new DevPlaninspectionpointTWritingDAO(_dbWriteManager);
			this._devPlanroutedataTQueryDAO = new DevPlanroutedataTQueryDAO(_dbQueryManager);
			this._devPlanroutedataTWritingDAO = new DevPlanroutedataTWritingDAO(_dbWriteManager);
			this._devProcessimTQueryDAO = new DevProcessimTQueryDAO(_dbQueryManager);
			this._devProcessimTWritingDAO = new DevProcessimTWritingDAO(_dbWriteManager);
			this._devProcessimgroupTQueryDAO = new DevProcessimgroupTQueryDAO(_dbQueryManager);
			this._devProcessimgroupTWritingDAO = new DevProcessimgroupTWritingDAO(_dbWriteManager);
			this._devProcessinfoTQueryDAO = new DevProcessinfoTQueryDAO(_dbQueryManager);
			this._devProcessinfoTWritingDAO = new DevProcessinfoTWritingDAO(_dbWriteManager);
			this._devSparepartTQueryDAO = new DevSparepartTQueryDAO(_dbQueryManager);
			this._devSparepartTWritingDAO = new DevSparepartTWritingDAO(_dbWriteManager);
			this._devTroublereportinfoTQueryDAO = new DevTroublereportinfoTQueryDAO(_dbQueryManager);
			this._devTroublereportinfoTWritingDAO = new DevTroublereportinfoTWritingDAO(_dbWriteManager);
			this._devUserpositiondataTQueryDAO = new DevUserpositiondataTQueryDAO(_dbQueryManager);
			this._devUserpositiondataTWritingDAO = new DevUserpositiondataTWritingDAO(_dbWriteManager);
			this.DevInspectiondeviceTList = new DevInspectiondeviceTList(this._devInspectiondeviceTQueryDAO, this._devInspectiondeviceTWritingDAO);
			this.DevInspectionpointinfoTList = new DevInspectionpointinfoTList(this._devInspectionpointinfoTQueryDAO, this._devInspectionpointinfoTWritingDAO);
			this.DevInspectionstepTList = new DevInspectionstepTList(this._devInspectionstepTQueryDAO, this._devInspectionstepTWritingDAO);
			this.DevJobinspectionstepTList = new DevJobinspectionstepTList(this._devJobinspectionstepTQueryDAO, this._devJobinspectionstepTWritingDAO);
			this.DevJobpersonsTList = new DevJobpersonsTList(this._devJobpersonsTQueryDAO, this._devJobpersonsTWritingDAO);
			this.DevJobplanTList = new DevJobplanTList(this._devJobplanTQueryDAO, this._devJobplanTWritingDAO);
			this.DevJobsparepartTList = new DevJobsparepartTList(this._devJobsparepartTQueryDAO, this._devJobsparepartTWritingDAO);
			this.DevJobteamsTList = new DevJobteamsTList(this._devJobteamsTQueryDAO, this._devJobteamsTWritingDAO);
			this.DevJobworksheetTList = new DevJobworksheetTList(this._devJobworksheetTQueryDAO, this._devJobworksheetTWritingDAO);
			this.DevMaintenancedetailTList = new DevMaintenancedetailTList(this._devMaintenancedetailTQueryDAO, this._devMaintenancedetailTWritingDAO);
			this.DevMajorrepairdetailTList = new DevMajorrepairdetailTList(this._devMajorrepairdetailTQueryDAO, this._devMajorrepairdetailTWritingDAO);
			this.DevPlandeviceTList = new DevPlandeviceTList(this._devPlandeviceTQueryDAO, this._devPlandeviceTWritingDAO);
			this.DevPlaninspectionpointTList = new DevPlaninspectionpointTList(this._devPlaninspectionpointTQueryDAO, this._devPlaninspectionpointTWritingDAO);
			this.DevPlanroutedataTList = new DevPlanroutedataTList(this._devPlanroutedataTQueryDAO, this._devPlanroutedataTWritingDAO);
			this.DevProcessimTList = new DevProcessimTList(this._devProcessimTQueryDAO, this._devProcessimTWritingDAO);
			this.DevProcessimgroupTList = new DevProcessimgroupTList(this._devProcessimgroupTQueryDAO, this._devProcessimgroupTWritingDAO);
			this.DevProcessinfoTList = new DevProcessinfoTList(this._devProcessinfoTQueryDAO, this._devProcessinfoTWritingDAO);
			this.DevSparepartTList = new DevSparepartTList(this._devSparepartTQueryDAO, this._devSparepartTWritingDAO);
			this.DevTroublereportinfoTList = new DevTroublereportinfoTList(this._devTroublereportinfoTQueryDAO, this._devTroublereportinfoTWritingDAO);
			this.DevUserpositiondataTList = new DevUserpositiondataTList(this._devUserpositiondataTQueryDAO, this._devUserpositiondataTWritingDAO);
		}

		public IDevInspectiondeviceTList DevInspectiondeviceTList
		{
			get;
			private set;
		}

		public IDevInspectionpointinfoTList DevInspectionpointinfoTList
		{
			get;
			private set;
		}

		public IDevInspectionstepTList DevInspectionstepTList
		{
			get;
			private set;
		}

		public IDevJobinspectionstepTList DevJobinspectionstepTList
		{
			get;
			private set;
		}

		public IDevJobpersonsTList DevJobpersonsTList
		{
			get;
			private set;
		}

		public IDevJobplanTList DevJobplanTList
		{
			get;
			private set;
		}

		public IDevJobsparepartTList DevJobsparepartTList
		{
			get;
			private set;
		}

		public IDevJobteamsTList DevJobteamsTList
		{
			get;
			private set;
		}

		public IDevJobworksheetTList DevJobworksheetTList
		{
			get;
			private set;
		}

		public IDevMaintenancedetailTList DevMaintenancedetailTList
		{
			get;
			private set;
		}

		public IDevMajorrepairdetailTList DevMajorrepairdetailTList
		{
			get;
			private set;
		}

		public IDevPlandeviceTList DevPlandeviceTList
		{
			get;
			private set;
		}

		public IDevPlaninspectionpointTList DevPlaninspectionpointTList
		{
			get;
			private set;
		}

		public IDevPlanroutedataTList DevPlanroutedataTList
		{
			get;
			private set;
		}

		public IDevProcessimTList DevProcessimTList
		{
			get;
			private set;
		}

		public IDevProcessimgroupTList DevProcessimgroupTList
		{
			get;
			private set;
		}

		public IDevProcessinfoTList DevProcessinfoTList
		{
			get;
			private set;
		}

		public IDevSparepartTList DevSparepartTList
		{
			get;
			private set;
		}

		public IDevTroublereportinfoTList DevTroublereportinfoTList
		{
			get;
			private set;
		}

		public IDevUserpositiondataTList DevUserpositiondataTList
		{
			get;
			private set;
		}

		protected override void Dispose(bool disposing)
		{
			if (!disposed && disposing)
			{
				_dbQueryManager.Dispose();
				_dbWriteManager.Dispose();
			}

			base.Dispose(disposing);

		}
	}
}
